//
//  ResumeCollectionViewCell.m
//  u76ho
//
//  Created by m-air-01 on 16/1/8.
//  Copyright © 2016年 LV. All rights reserved.
//

#import "ResumeCollectionViewCell.h"

@implementation ResumeCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    for (int i = 0; i<3; i++) {
        UIView * linev = [[UIView alloc]initWithFrame:CGRectMake((SCREEN_WIDTH-SIZETO6W(15))/4+i*((SCREEN_WIDTH-SIZETO6W(15))/4), _lineBV.bottom+11, 1, 22)];
        linev.backgroundColor = UIColorFromRGB(0xdfdfdf);
        [self addSubview:linev];
    }
}

- (IBAction)refreshBtnAction:(id)sender {
    if (_refreshBlock) {
        _refreshBlock();
    }
}
- (IBAction)editingBtnAction:(id)sender {
    if (_block) {
        _block(YES);
    }
}
- (IBAction)shouxuanBtnAction:(id)sender {
    if (_block) {
        _block(NO);
    }
}
- (IBAction)deleteBtnAction:(id)sender {
    if (_deleteBlock) {
        _deleteBlock();
    }
}

-(void)setModel:(RusumeHomePageOneModel *)model
{
    _model = model;
    _zhiweiLab.text = model.title;
    if ([model.istop isEqualToString:@"1"]) {
        _morenLab.hidden = NO;
        [_shouxuanBtn setImage:[UIImage imageNamed:@"jl－icon－right"] forState:UIControlStateNormal];
    }
    else
    {
        _morenLab.hidden = YES;
        [_shouxuanBtn setImage:[UIImage imageNamed:@"jl－icon－right－pre"] forState:UIControlStateNormal];
    }
    
    //时间
    NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
    formatter.dateFormat = @"yyyy-MM-dd";
    NSString * dataCh = model.lasttime;
    NSString * dataStr = [dataCh substringToIndex:dataCh.length];
    NSDate * data = [[NSDate dateWithTimeIntervalSince1970:[dataStr integerValue]] dateByAddingTimeInterval:8*3600];
    NSString * lastStr = [NSString stringWithFormat:@"%@",data];
    NSArray * lastArr = [lastStr componentsSeparatedByString:@" "];
    _dateLab.text = lastArr[0];

}

@end
